/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1590626515546_7609';

  // 注册中间件的地方
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    security: { // 关闭csrf
      csrf: false
    },
    mysql: {
      // 单数据库信息配置
      client: {
        // host
        host: 'localhost',
        // 端口号 // 数据库默认端口
        port: '3306', // 
        // 用户名
        user: 'root',
        // 密码
        password: '3051532wyp.',
        // 数据库名
        database: 's_1711A_demo',
      }
    },
    cors: {
      // {string|Function} 
      origin: '*',
      // {string|Array}
      allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
    }
  }

  return {
    ...config,
    ...userConfig,
  };
};
